package com.ltkj.baseplatform.feign;

import com.ltkj.common.core.constant.SecurityConstants;
import com.ltkj.common.core.constant.ServiceNameConstants;
import com.ltkj.common.core.domain.R;
import com.ltkj.common.core.web.domain.AjaxResult;
import com.ltkj.system.api.domain.SysUser;
import com.ltkj.system.api.factory.RemoteFileFallbackFactory;
import com.ltkj.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "remoteSysemUserService", value = ServiceNameConstants.SYSTEM_SERVICE)
public interface RemoteSysemUserService {

    /**
     * 注册用户
     * @param user
     * @return
     */
    @PostMapping("/user/registerForWx")
    R<Boolean> registerForWx(@RequestBody SysUser user,@RequestParam("roleId") Long roleId,@RequestHeader (SecurityConstants.FROM_SOURCE)String source);

    /**
     * 根据登录账号获取用户信息
     * @param username
     * @return
     */
    @GetMapping("/user/info/{username}")
    R<LoginUser> info(@PathVariable("username") String username, @RequestHeader (SecurityConstants.FROM_SOURCE)String source);

    /**
     * 根据手机号获取个人信息
     * @param phone
     * @return
     */
    @GetMapping("/user/getInfoByPhone")
    AjaxResult getInfoByPhone(@RequestParam("phone") String phone);
    @GetMapping("/user/getInfoByLogin")
    AjaxResult getInfoByLogin();

    /**
     * 微信端修改用户
     * @param user
     * @return
     */
    @PostMapping("/user/edit")
    R editUser(@RequestBody SysUser user,@RequestHeader (SecurityConstants.FROM_SOURCE)String source);

}
